disk: Prevent overflows when allocating memory for arrays
authorAlec Brown <alec.r.brown@oracle.com>
Wed, 22 Jan 2025 02:55:10 +0000 (02:55 +0000)
committerFelix Zielcke <fzielcke@z-51.de>
Thu, 3 Jul 2025 16:35:51 +0000 (18:35 +0200)
commit481990bd0aa31884828cebaf00b5a0e88545bd2b
tree9190a3c13c13904b83a4ec8ee4ce00bc6e3805d9
parentbfa6a8664b5564cd4e9c68bb2b55b8c2a1233bfd
disk: Prevent overflows when allocating memory for arrays

Use grub_calloc() when allocating memory for arrays to ensure proper
overflow checks are in place.

Signed-off-by: Alec Brown <alec.r.brown@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Conflicts:
grub-core/disk/cryptodisk.c

Gbp-Pq: Topic cve-2025-jan
Gbp-Pq: Name disk-Prevent-overflows-when-allocating-memory-for-arrays.patch
grub-core/disk/lvm.c